<template>
  <view class="fun-list">
    <view class="list-item" v-for="item in funList" :key="item.id" @tap="itemClick(item.id)">
      <view class="left">
        <view class="img">
          <image :src="item.icon" mode="" class="icon"></image>
        </view>
        <view class="title">{{item.name}}</view>
      </view>
      <view class="right">
        <u-icon name="arrow-right" color="#111" size="22"></u-icon>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        funList: [{
            id: 1,
            name: '个人信息',
            icon: require('@/static/images/profile/funList/collection.png')
          },
		  {
            id: 3,
            name: '修改密码',
            icon: require('@/static/images/profile/funList/community.png')
          },
          {
            id: 2,
            name: '我的订单',
            icon: require('@/static/images/profile/funList/order.png')
          },
          {
            id: 4,
            name: '系统消息',
            icon: require('@/static/images/profile/funList/tips.png')
          },
          {
            id: 5,
            name: '退出登录',
            icon: require('@/static/images/profile/funList/setting.png')
          }
        ]
      };
    },
    methods: {
      itemClick(index) {
        switch (index) {
          case 1://收藏
            uni.navigateTo({
              url: '../../pages/setting/myInfo/myInfo'
            })
            break;
          case 2://我的订单
            uni.navigateTo({
              url: '../../pages/profile/orderList/orderList'
            })
            break;
          case 3://社区中心
            uni.navigateTo({
              url: '../../pages/setting/updatePsd/updatePsd'
            })
            break;
          case 4://系统信息
            uni.navigateTo({
              url: '../../pages/profile/systemInfo/systemInfo'
            })
            break;
          case 5://设置
            uni.navigateTo({
              url: '../../'
            })
            break;
          default:
            break;
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .fun-list {
    padding: 30upx 30upx;

    .list-item {
      width: 100%;
      height: 120upx;
      background: #ffffff;
      border-radius: 16upx;
      box-shadow: 0px 4upx 4upx 0px rgba(158, 158, 158, 0.10), 0px -2upx 4upx 0px rgba(255, 255, 255, 0.02);
      display: flex;
      justify-content: space-between;
      margin-bottom: 20upx;

      .left {
        display: flex;

        .img {
          width: 100upx;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;

          .icon {
            width: 60upx;
            height: 60upx;
          }
        }

        .title {
          font-size: 28upx;
          font-weight: 400;
          color: #424242;
          letter-spacing: 0.14upx;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }

      .right {
        width: 60upx;
        display: flex;
        align-items: center;
      }
    }
  }
</style>
